#!/bin/bash
now=$(date +%s)
ps -eo pid  | sed '1d' | while read line ; do
    start=$(ps -p $line -o lstart  | sed '1d')
    startsec=$(date -d "$start" +%s)
    
    let num=now-startsec
    if [ $num -le 600  ] ; then
       echo "进程名称：$(ps -p $line -o comm |sed '1d')  进程id: $line  启动时间：$start"
    fi
done
